<template>
  <div>
    <a-form :form="form" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }" >
      <a-form-item label="开学日期">
        <a-date-picker v-model="formState.startDate" />
      </a-form-item>
      <a-form-item label="结束日期">
        <a-date-picker v-model="formState.endDate" />
      </a-form-item>
      <a-form-item label="教学周数">
        <a-input-number v-model="formState.weeks" />
      </a-form-item>
       <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
            <a-button type="primary" html-type="submit" @click="submitForm">
              保存
            </a-button>
          </a-form-item>
    </a-form>
  </div>
</template>

<script>

export default {
  data() {
    return {
      form: this.$form.createForm(this),
      formState: {
        startDate: null,
        endDate: null,
        weeks: 0
      }
    };
  },
  methods: {
    submitForm() {
      this.form.validateFields((err, values) => {
        if (!err) {
          console.log('教学周期维护提交的数据:', values);
          // 这里可以添加实际的保存逻辑
        }
      });
    }
  }
};
</script>    